//
//  MSettingCell.m
//  Mask
//
//  Created by 郭子一 on 2020/10/3.
//  Copyright © 2020 郭子一. All rights reserved.
//

#import "MSettingCell.h"

@implementation MSettingCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = UIColor.clearColor;
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    __weak typeof(self) weakSelf = self;
    self.titleLab = [UILabel new];
    self.titleLab.font = JSS_FONT_6;
    self.titleLab.textColor = RGB_VALUE(0x5C5D66);
    [self.contentView addSubview:self.titleLab];
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(15);
        make.width.mas_equalTo(100);
        make.centerY.mas_equalTo(weakSelf.mas_centerY);
        make.top.bottom.offset(0);
    }];
    
    self.rightLab = [UILabel new];
    self.rightLab.font = JSS_FONT_6;
    self.rightLab.textColor = RGB_VALUE(0x5D6693);
    self.rightLab.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.rightLab];
    [self.rightLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-33);
        make.width.mas_equalTo(150);
        make.centerY.mas_equalTo(weakSelf.mas_centerY);
        make.top.bottom.offset(0);
    }];
    
    self.lineView = [UIView new];
    self.lineView.backgroundColor = RGB_VALUE(0xDEDEDE);
    [self.contentView addSubview:self.lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(13);
        make.right.offset(-13);
        make.height.mas_equalTo(1);
        make.bottom.offset(-1);
    }];
    
    self.rightArrowImg = [[UIImageView alloc] init];
    self.rightArrowImg.image = [UIImage imageNamed:@"arrowRight"];
    [self.contentView addSubview:self.rightArrowImg];
    [self.rightArrowImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(weakSelf.mas_centerY);
        make.right.offset(-10);
        make.width.mas_equalTo(16);
        make.height.mas_equalTo(16);
    }];
}
@end
